<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="true" name="HandheldFriendly">
    <title></title>
    <meta content="" name="keywords"/>
    <meta content="" name="description"/>
    <link href="/web/css/normalize.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/animate.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="/web/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>
<body>
<div id="app" v-cloak>
    <div class="contain">
        <div class="sidebar" id="head"></div>
        <section>
            <div class="right_h" id="right_h"></div>
            <div class="qulicklink">
                <ul>
                    <li><a href="javascript:;"></a></li>
                    <li><a href="javascript:;"><span>企业首页</span><img src="../web/images/close.png"></a></li>
                    <li class="dq"><a href="javascript:;"><span>业务管理</span><img src="../web/images/close.png"></a></li>
                    <li><a href="javascript:;"></a></li>
                </ul>
            </div>
            <div class="breadcrumbs">
                <ul>
                    <li>业务管理</li>
                    <li><a href="customer-files.html">客户档案</a></li>
                    <li>客户详情</li>
                </ul>
            </div>
            <div class="clearfix"></div>
            <div class="t_body">
                <div class="table-responsive">
                    <table class="table">
                        <thead>
                        <tr>
                            <th colspan="4" style="text-align: left; padding-left: 20px">客户详情</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="rowcol">
                            <td>客户名称:</td>
                            <td id="archivescustomer">{{tableDataList.title}}</td>
                            <td>客户网址:</td>
                            <td>{{tableDataList.link}}</td>
                        </tr>
                        <tr class="rowcol">
                            <td>联系人:</td>
                            <td id="archivescontacts">{{tableDataList.contacts}}</td>
                            <td>电话号码:</td>
                            <td>{{tableDataList.tel}}</td>
                        </tr>
                        <tr class="rowcol">
                            <td>省份:</td>
                            <td id="archivescontacts">{{tableDataList.provincename}}</td>
                            <td>城市:</td>
                            <td>{{tableDataList.cityname}}</td>
                        </tr>
                        <tr class="rowcol">
                            <td>客户地址:</td>
                            <td>{{tableDataList.address}}</td>
                            <td>客户类型:</td>
                            <td>{{tableDataList.typetitle}}</td>
                        </tr>
                        <tr class="rowcol">
                            <td>客户来源:</td>
                            <td>{{tableDataList.fromtitle}}</td>
                            <td>客户及别:</td>
                            <td>{{tableDataList.categorytitle}}</td>
                        </tr>
                        <tr class="rowcol">
                            <td>客户行业:</td>
                            <td>{{tableDataList.industrytitle}}</td>
                            <td>咨询日期:</td>
                            <td>{{tableDataList.firsttime}}</td>
                        </tr>
                        <tr class="rowcol">
                            <td>分配人:</td>
                            <td>{{tableDataList.username}}</td>
                            <td>客户状态:</td>
                            <td>{{tableDataList.status == 1 ? '有效' : '无效' }}</td>
                        </tr>
                        <tr class="rowcol">
                            <td>备注:</td>
                            <td>{{tableDataList.content}}</td>
                            <td></td>
                            <td></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--这里是tab栏切换开始-->
            <div class="tabContent">
                <div class="layui-tab layui-tab-card">
                    <ul class="layui-tab-title">
                        <li class="layui-this">联系人</li>
                        <li>回访</li>
                        <li>项目报价</li>
                        <li>业务合同</li>
                        <li>发票管理</li>
                        <li>业务收款</li>
                        <li>开票信息</li>
                    </ul>
                    <div class="layui-tab-content" style="height: 100px;">
                        <!--联系人模块开始-->
                        <div class="layui-tab-item layui-show">
                            <div class="layuiBtns">
                                <div class="addbtn">
                                    <a @click="addcontactClick()" href="javascript:;">新增</a>
                                </div>
                                <div class="deletebtn">
                                    <a @click="deletecontactClick()" href="javascript:;">删除</a>
                                </div>
                            </div>
                            <div class="layui-table">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><input @click="choseCheckAll(contactsDataList,'contacts')"
                                                       class="checkboxAll" id="contactschoseall" type="checkbox"> 全选
                                            </th>
                                            <th>姓名</th>
                                            <th>职务</th>
                                            <th>性别</th>
                                            <th>手机</th>
                                            <th>QQ</th>
                                            <th>Email</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr @dblclick="editorcontactClick(v.id)" v-for="(v,index) in contactsDataList">
                                            <td><input :id="'contactslistcheck' + (v.id)" class="selectCheck"
                                                       type="checkbox"></td>
                                            <td>{{v.name}}</td>
                                            <td>{{v.character}}</td>
                                            <td>{{v.sex == 1 ? '先生' : '女士' }}</td>
                                            <td>{{v.phone}}</td>
                                            <td>{{v.qq}}</td>
                                            <td>{{v.email}}</td>
                                            <td>
                                                <div class="editor">
                                                    <a @click="editorcontactClick(v.id)" href="javascript:;">
                                                        <img src="images/editor.png">
                                                    </a>
                                                    <span>编辑</span>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 这里是新增编辑联系人弹出框开始-->
                        <div class="addContact hidden">
                            <div class="addtitle">联系人信息</div>
                            <div class="layerbody">
                                <label>
                                    <span>联系人:</span> <input autocomplete="off" class="name" id="contactsname"
                                                              name="resetTc" placeholder="请输入客户姓名" type="text"/>
                                </label>
                                <label>
                                    <span>职务:</span>
                                    <input autocomplete="off" class="department" id="contactscharacter" name="resetTc"
                                           placeholder="请输入客户职务" type="text"/>
                                </label>
                                <label>
                                    <span>性别:</span>
                                    <input checked class="radio radio1" name="sexresetTc" type="radio"
                                           v-model="contactssex"
                                           value="1"/> 男
                                    <input class="radio" id="nv" name="sexresetTc" type="radio" v-model="contactssex"
                                           value="0"> 女
                                </label>
                                <label>
                                    <span>手机号码:</span> <input autocomplete="off" class="department" id="contactsphone"
                                                              maxlength="11" name="resetTc" placeholder="请输入手机号码"
                                                              type="text"/>
                                </label>
                                <label>
                                    <span>QQ:</span> <input autocomplete="off" class="qqnum" id="contactsqq"
                                                            name="resetTc" placeholder="请输入QQ" type="text"/>
                                </label>
                                <label>
                                    <span>Email:</span> <input autocomplete="off" class="email" id="contactsemail"
                                                               name="resetTc" placeholder="请输入Email" type="text"/>
                                </label>
                            </div>
                            <button @click="addeditcontacttssave()" class="surebtn" type="submit">确认</button>
                            <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                        </div>
                        <!-- 这里是新增联系人弹出框结束-->
                        <!--联系人模块结束-->


                        <!--回访模块开始-->
                        <div class="layui-tab-item">
                            <div class="layuiBtns">
                                <div class="addbtn">
                                    <a @click="addvisitClick()" href="javascript:;">新增</a>
                                </div>
                                <div class="deletebtn">
                                    <a @click="deletetrackClick()" href="javascript:;">删除</a>
                                </div>
                            </div>
                            <div class="layui-table">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><input @click="choseCheckAll(trackDataList,'track')" class="checkboxAll"
                                                       id="trackchoseall" type="checkbox"> 全选
                                            </th>
                                            <th>客户状态</th>
                                            <th>提醒日期</th>
                                            <th>跟进日期</th>
                                            <th>回访记录</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr @dblclick="editorvisitClick(v.id)" v-for="(v,index) in trackDataList">
                                            <td><input :id="'tracklistcheck' + (v.id)" class="selectCheck"
                                                       type="checkbox"></td>
                                            <td>{{v.status == 1 ? '有效' : '无效' }}</td>
                                            <td>{{v.remindtime}}</td>
                                            <td>{{v.tracktime}}</td>
                                            <td>{{v.content}}</td>
                                            <td>
                                                <div class="editor">
                                                    <a @click="editorvisitClick(v.id)" href="javascript:;">
                                                        <img src="images/editor.png">
                                                    </a>
                                                    <span>编辑</span>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 这里是新增回访弹出框开始-->
                        <div class="addVisit hidden">
                            <div class="addtitle">回访信息</div>
                            <div class="layerbody">
                                <label>
                                    <span>跟进方式:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="industry" id="trackfunid"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="type">
                                            <option class="promptColor" value="0">请选择跟进方式</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.trackfun">{{v.title}}
                                            </option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>跟进人:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="industry" id="trackuserid"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="(user)">
                                            <option class="promptColor" value="0">请选择跟进人</option>
                                            <option :value="v.id" v-for="(v,k) in contactsDataList">{{v.name}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>跟进阶段:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="industry" id="trackstageid"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="trackstageid">
                                            <option class="promptColor" value="0">请选择跟进阶段</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.trackstage">{{v.title}}
                                            </option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>提醒日期:</span>
                                    <div class="layui-input-inline">
                                        <input autocomplete="off" class="layui-input" id="trackremindtime"
                                               name="resetTc" placeholder="yyyy-MM-dd" type="text"/>
                                    </div>
                                </label>
                                <label>
                                    <span>跟进日期:</span>
                                    <div class="layui-input-inline">
                                        <input autocomplete="off" class="layui-input" id="tracktracktime"
                                               name="resetTc" placeholder="yyyy-MM-dd" type="text"/>
                                    </div>
                                </label>
                                <div class="address">
                                    <label>
                                        <span>回访记录:</span>
                                        <textarea autocomplete="off" class="contents" id="trackcontent" name="resetTc"
                                                  placeholder="回访记录" resize="" rows="4"></textarea>
                                    </label>
                                </div>
                            </div>
                            <button @click="addedittracksave()" class="surebtn" type="submit">确认</button>
                            <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                        </div>
                        <!-- 这里是新增回访弹出框结束-->
                        <!--回访模块结束-->

                        <!--项目报价模块开始-->
                        <div class="layui-tab-item">
                            <div class="layuiBtns">
                                <div class="addbtn">
                                    <a @click="addprojectClick()" href="javascript:;">新增</a>
                                </div>
                                <div class="deletebtn">
                                    <a @click="deleteorderClick()" href="javascript:;">删除</a>
                                </div>
                            </div>
                            <div class="layui-table">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><input @click="choseCheckAll(orderDataList,'order')" class="checkboxAll"
                                                       id="orderchoseall" type="checkbox"> 全选
                                            </th>
                                            <th>订单状态</th>
                                            <th>订单金额</th>
                                            <th>支付方式</th>
                                            <th>成交时间</th>
                                            <th>成交人员</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr @dblclick="editorprojectClick(v.id)" v-for="(v,index) in orderDataList">
                                            <td><input :id="'orderlistcheck' + (v.id)" class="selectCheck"
                                                       type="checkbox"></td>
                                            <td>{{v.orderstatustitle}}</td>
                                            <td>{{v.orderprice}}</td>
                                            <td>{{v.paytypetitle}}</td>
                                            <td>{{v.successtime}}</td>
                                            <td>{{v.realname}}</td>
                                            <td>
                                                <div class="editor">
                                                    <a @click="editorprojectClick(v.id)" href="javascript:;">
                                                        <img src="images/editor.png">
                                                    </a>
                                                    <span>编辑</span>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 这里是项目报价弹出框开始-->
                        <div class="addProject hidden">
                            <div class="addtitle">项目报价信息</div>
                            <div class="layerbody">
                                <label>
                                    <span>订单状态:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="type" id="orderstatus"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="status">
                                            <option class="promptColor" value="0">请选择订单状态</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.orderstatus">{{v.title}}
                                            </option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>订单金额:</span> <input autocomplete="off" id="orderprice" name="resetTc"
                                                              placeholder="0.00" type="number"/>
                                </label>
                                <label>
                                    <span>优惠金额:</span> <input autocomplete="off" id="orderdiscountprice"
                                                              name="resetTc"
                                                              placeholder="0.00" type="number"/>
                                </label>
                                <label>
                                    <span>支付方式:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="type" id="orderpaytype"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="type">
                                            <option class="promptColor" value="0">请选择支付的方式</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.paytype">{{v.title}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>客户来源:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="type" id="orderfrom"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="from">
                                            <option class="promptColor" value="0">请选择客户来源</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.from">{{v.title}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>成交人员:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="industry" id="orderuser"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="user">
                                            <option class="promptColor" value="0">请选择成交人员</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.user">{{v.realname}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>成交时间:</span>
                                    <div class="layui-input-inline">
                                        <input autocomplete="off" class="layui-input" id="ordersuccesstime"
                                               name="resetTc" placeholder="yyyy-MM-dd" type="text">
                                    </div>
                                </label>
                            </div>
                            <button @click="addeditordersave()" class="surebtn" type="submit">确认</button>
                            <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                        </div>
                        <!-- 这里是项目报价弹出框结束-->
                        <!--项目报价模块结束-->

                        <!--业务合同模块开始-->
                        <div class="layui-tab-item">
                            <div class="layuiBtns">
                                <div class="addbtn">
                                    <a @click="addcontractClick()" href="javascript:;">新增</a>
                                </div>
                                <div class="deletebtn">
                                    <a @click="deletecontractClick()" href="javascript:;">删除</a>
                                </div>
                            </div>
                            <div class="layui-table">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><input @click="choseCheckAll(contractDataList,'contract')"
                                                       class="checkboxAll" id="contractchoseall" type="checkbox"> 全选
                                            </th>
                                            <th>合同名称</th>
                                            <th>合同金额</th>
                                            <th>签订时间</th>
                                            <th>合同类型</th>
                                            <th>签订人员</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr @dblclick="editorcontractClick(v.id)" v-for="(v,index) in contractDataList">
                                            <td><input :id="'contractlistcheck' + (v.id)" class="selectCheck"
                                                       type="checkbox"></td>
                                            <td>{{v.title}}</td>
                                            <td>{{v.contractprice}}</td>
                                            <td>{{v.successtime}}</td>
                                            <td>{{v.contracttypetitle}}</td>
                                            <td>{{v.name}}</td>
                                            <td>
                                                <div class="editor">
                                                    <a @click="editorcontractClick(v.id)" href="javascript:;">
                                                        <img src="images/editor.png">
                                                    </a>
                                                    <span>编辑</span>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 这里是业务合同弹出框开始-->
                        <div class="addContract hidden">
                            <div class="addtitle">业务合同信息</div>
                            <div class="layerbody">
                                <label>
                                    <span>合同名称:</span> <input autocomplete="off" class="htname" id="contracttitle"
                                                              name="resetTc" placeholder="合同名称"
                                                              type="text"/>
                                </label>
                                <label>
                                    <span>合同金额:</span> <input autocomplete="off" class="htmoney"
                                                              id="contentcontractprice" name="resetTc" placeholder="0.0"
                                                              type="text"/>
                                </label>
                                <label>
                                    <span>签订时间:</span>
                                    <div class="layui-input-inline">
                                        <input autocomplete="off" class="layui-input signedtime"
                                               id="contractsuccesstime" name="resetTc"
                                               placeholder="yyyy-MM-dd" type="text">
                                    </div>
                                </label>
                                <label>
                                    <span>合同类型:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="contractype" id="contracttype"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="type">
                                            <option class="promptColor" value="0">请选择合同类型</option>
                                            <option :value="v.id" v-for="(v,index) in ajaxData.contracttype">{{v.title}}
                                            </option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>签订人员:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="person" id="contractuser"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="user">
                                            <option class="promptColor" value="0">请选择客服人员</option>
                                            <option :value="v.id" v-for="(v,index) in ajaxData.user">{{v.realname}}
                                            </option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>客服人员:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="personnel" id="contractserviceid"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="serviceid">
                                            <option class="promptColor" value="0">请选择客服人员</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.user">{{v.realname}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>支付方式:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="paytype" id="contractpaytype"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc"
                                                v-model="paytype">
                                            <option class="promptColor" value="0">请选择支付的方式</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.paytype">{{v.title}}</option>
                                        </select>
                                    </div>
                                </label>
                            </div>
                            <button @click="addeditcontractssave()" class="surebtn" type="submit">确认</button>
                            <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                        </div>
                        <!-- 这里是业务合同弹出框结束-->
                        <!--业务合同模块结束-->

                        <!--发票管理模块开始-->
                        <div class="layui-tab-item">
                            <div class="layuiBtns">
                                <div class="addbtn">
                                    <a @click="addinvoiceClick()" href="javascript:;">新增</a>
                                </div>
                                <div class="deletebtn">
                                    <a @click="deleteinvoiceClick()" href="javascript:;">删除</a>
                                </div>
                            </div>
                            <div class="layui-table">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><input @click="choseCheckAll(invoiceDataList,'invoice')"
                                                       class="checkboxAll" id="invoicechoseall" type="checkbox"> 全选
                                            </th>
                                            <th>发票类型</th>
                                            <th>发票金额</th>
                                            <th>开票日期</th>
                                            <th>是否开票</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr @dblclick="editorinvoiceClick(v.id)" v-for="(v,index) in invoiceDataList">
                                            <td><input :id="'invoicelistcheck' + (v.id)" class="selectCheck"
                                                       type="checkbox"></td>
                                            <td>{{v.invoicetypetitle}}</td>
                                            <td>{{v.invoiceprice}}</td>
                                            <td>{{v.maketime}}</td>
                                            <td>{{v.ismake == 1 ? '是' : '否' }}</td>
                                            <td>
                                                <div class="editor">
                                                    <a @click="editorinvoiceClick(v.id)" href="javascript:;">
                                                        <img src="images/editor.png">
                                                    </a>
                                                    <span>编辑</span>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 这里是发票管理模弹出框开始-->
                        <div class="addInvoice hidden">
                            <div class="addtitle">发票管理信息</div>
                            <div class="layerbody">
                                <label>
                                    <span>发票类型:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="type" id="invoicetype"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="type">
                                            <option class="promptColor" value="0">请选择发票类型</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.paytype">{{v.title}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>合同:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="type" id="invoicefrom"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="from">
                                            <option class="promptColor" value="0">请选择合同</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.code">{{v.code}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>发票金额:</span> <input autocomplete="off" id="invoiceprice" name="resetTc"
                                                              placeholder="0.0" type="text"/>
                                </label>
                                <label>
                                    <span>开票时间:</span>
                                    <div class="layui-input-inline">
                                        <input autocomplete="off" class="layui-input" id="invoicemaketime"
                                               name="resetTc"
                                               placeholder="yyyy-MM-dd" type="text"/>
                                    </div>
                                </label>
                                <label>
                                    <span>是否开票:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="type" id="invoiceismake"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="status">
                                            <option class="promptColor" value="0">请选择是否开票</option>
                                            <option value="1">是</option>
                                            <option value="2">否</option>
                                        </select>
                                    </div>
                                </label>
                            </div>
                            <button @click="addeditinvoicesave()" class="surebtn" type="submit">确认</button>
                            <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                        </div>
                        <!-- 这里是发票管理模弹出框结束-->
                            <!--这里是读取合同弹出框开始-->
                        <div class="orderBox hidden">
                            <div class="layerbody layerbody_p">
                                <ul class="orderList">
                                    <li class="listBg">
                                        <ol>合同编号</ol>
                                        <ol>客户名称</ol>
                                        <ol>订单金额</ol>
                                        <ol>支付方式</ol>
                                        <ol>收款人</ol>
                                    </li>
                                    <li>
                                        <ol></ol>
                                        <ol></ol>
                                        <ol></ol>
                                        <ol></ol>
                                        <ol></ol>
                                    </li>
                                </ul>
                            </div>
                        </div>
                            <!--这里是读取合同弹出框结束-->
                        <!--发票管理模块结束-->

                        <!--业务收款模块开始-->
                        <div class="layui-tab-item">
                            <div class="layuiBtns">
                                <div class="addbtn">
                                    <a @click="addcollectionClick()" href="javascript:;">新增</a>
                                </div>
                                <div class="deletebtn">
                                    <a @click="deletecollectionClick()" href="javascript:;">删除</a>
                                </div>
                            </div>
                            <div class="layui-table">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><input @click="choseCheckAll(collectionDataList,'collection')"
                                                       class="checkboxAll" id="collectionchoseall" type="checkbox"> 全选
                                            </th>
                                            <th>收款金额</th>
                                            <th>收款时间</th>
                                            <th>支付方式</th>
                                            <th>收款人</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr @dblclick="editorcollectionClick(v.id)"
                                            v-for="(v,index) in collectionDataList">
                                            <td><input :id="'collectionlistcheck' + (v.id)" class="selectCheck"
                                                       type="checkbox"></td>
                                            <td>{{v.collectionprice}}</td>
                                            <td>{{v.collectiontime}}</td>
                                            <td>{{v.parametertitle}}</td>
                                            <td>{{v.realname}}</td>
                                            <td>
                                                <div class="editor">
                                                    <a @click="editorcollectionClick(v.id)" href="javascript:;">
                                                        <img src="images/editor.png">
                                                    </a>
                                                    <span>编辑</span>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 这里是业务收款模弹出框开始-->
                        <div class="addCollection hidden">
                            <div class="addtitle">业务收款信息</div>
                            <div class="layerbody">
                                <label>
                                    <span>收款金额:</span> <input autocomplete="off" class="skprice" id="collectionprice"
                                                              name="resetTc" placeholder="0.0" type="text"/>
                                </label>
                                <label>
                                    <span>收款日期:</span>
                                    <div class="layui-input-inline">
                                        <input autocomplete="off" class="layui-input" id="collectiontime"
                                               name="resetTc"
                                               placeholder="yyyy-MM-dd" type="text"/>
                                    </div>
                                </label>
                                <label>
                                    <span>选择合同:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="paytype" id="collectioncontract"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="contractid">
                                            <option class="promptColor" value="0">选择合同</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.code">{{v.title}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>支付方式:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="paytype" id="collectionpaytype"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="type">
                                            <option class="promptColor" value="0">请选择支付的方式</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.paytype">{{v.title}}</option>
                                        </select>
                                    </div>
                                </label>
                                <label>
                                    <span>收款人:</span>
                                    <div class="layui-input-block">
                                        <select autocomplete="off" class="payee" id="collectionuser"
                                                lay-filter="batch" lay-search="required" lay-verify="required"
                                                name="resetTc" v-model="user">
                                            <option class="promptColor" value="0">请选择收款人</option>
                                            <option :value="v.id" v-for="(v,k) in ajaxData.user">{{v.realname}}</option>
                                        </select>
                                    </div>
                                </label>
                            </div>
                            <button @click="addeditcollectionsave()" class="surebtn" type="submit">确认</button>
                            <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                        </div>
                        <!-- 这里是业务收款模弹出框结束-->
                        <!--业务收款模块结束-->

                        <!--开票信息模块开始-->
                        <div class="layui-tab-item">
                            <div class="layuiBtns">
                                <div class="addbtn">
                                    <a @click="addBillingClick()" href="javascript:;">新增</a>
                                </div>
                                <div class="deletebtn">
                                    <a @click="deleteBillingClick()" href="javascript:;">删除</a>
                                </div>
                            </div>
                            <div class="layui-table">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><input @click="choseCheckAll(billingDataList,'billing')"
                                                       class="checkboxAll" id="billingchoseall" type="checkbox"> 全选
                                            </th>
                                            <th>公司全称</th>
                                            <th>注册地址</th>
                                            <th>开户行</th>
                                            <th>税号</th>
                                            <th>电话</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr @dblclick="editorbillingClick(v.id)"
                                            v-for="(v,index) in billingDataList">
                                            <td><input :id="'billinglistcheck' + (v.id)" class="selectCheck"
                                                       type="checkbox"></td>
                                            <td>{{v.title}}</td>
                                            <td>{{v.address}}</td>
                                            <td>{{v.bank}}</td>
                                            <td>{{v.code}}</td>
                                            <td>{{v.tel}}</td>
                                            <td>
                                                <div class="editor">
                                                    <a @click="editorbillingClick(v.id)" href="javascript:;">
                                                        <img src="images/editor.png">
                                                    </a>
                                                    <span>编辑</span>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 这里是开票信息弹出框开始-->
                        <div class="addBilling hidden">
                            <div class="addtitle">开票信息</div>
                            <div class="layerbody">
                                <label>
                                    <span>公司全称:</span> <input autocomplete="off" class="skprice" id="billingtitle"
                                                              name="resetTc" placeholder="0.0" type="text"/>
                                </label>
                                <label>
                                    <span>电话:</span> <input autocomplete="off" class="skprice" id="billingtel"
                                                            name="resetTc" placeholder="0.0" type="text"/>
                                </label>
                                <label>
                                    <span>开户行:</span> <input autocomplete="off" class="skprice" id="billingbank"
                                                             name="resetTc" placeholder="0.0" type="text"/>
                                </label>
                                <label>
                                    <span>税号:</span>  <input autocomplete="off" class="skprice" id="billingcode"
                                                             name="resetTc" placeholder="0.0" type="text"/>
                                </label>
                                <label>
                                    <span>注册地址:</span>
                                    <textarea autocomplete="off" class="contents" id="billingaddress" name="resetTc" placeholder="详细地址"
                                              resize="" rows="3" cols="35"></textarea>
                                </label>
                            </div>
                            <button @click="addeditBillingsave()" class="surebtn" type="submit">确认</button>
                            <button @click="addresetBtn()" class="resetbtn" type="submit">重置</button>
                        </div>
                        <!-- 这里是开票信息弹出框结束-->
                        <!--开票信息模块结束-->
                    </div>
                </div>
            </div>
            <!--这里是tab栏切换结束-->
        </section>
    </div>
</div>
<script src="/web/js/vue.js"></script>
<script src="/web/js/jquery-1.10.0.min.js"></script>
<script src="/web/layui/layui.js"></script>
<script src="/web/js/transform.js"></script>
<script>
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //回访提醒日期
        laydate.render({
            elem: '#trackremindtime', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
        //回访跟进日期
        laydate.render({
            elem: '#tracktracktime', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
        //项目报价成交时间
        laydate.render({
            elem: '#ordersuccesstime', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
        //业务合同签订时间
        laydate.render({
            elem: '#contractsuccesstime', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
        //发票管理开票日期
        laydate.render({
            elem: '#invoicemaketime', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
        //业务收款收款时间
        laydate.render({
            elem: '#collectiontime', //指定元素
            type: "date", // 组件的类型：year,month,time···
            format: 'yyyy-MM-dd'// 设置显示格式
        });
    });
</script>
<script>
    AppData = new Vue({
        el: '#app',
        data: {
            tableData: {},
            categoryIndex: 0,
            show: false,
            tableDataList: {},
            totalNum: 0, //总页数
            listRows: 8, //每页数量
            curNum: 1, //当前页码
            departmentList: {},
            dataList: {},
            archivesid: '',
            contactsDataList: {},
            trackDataList: {},
            orderDataList: {},
            invoiceDataList: {},
            billingDataList: {},
            contractDataList: {},
            collectionDataList: {},
            addoredit: 0,
            contactssex: 1,
            status: 0,
            type: 0,
            user: 0,
            from: 0,
            serviceid: 0,
            contractid: 0,
            paytype: 0,
            trackstageid: 0,
            ajaxData: [],
            characterid: 2
        },
        mounted() {
            $("#head").load("header.html");
            $("#right_h").load("right.html");
            this.getIndexData();
        },
        methods: {
            verification(data) {
                if (data.status == 2) {
                    layer.msg(data.message, {icon: 2, time: 1000}, function () {
                        window.location.href = "login.html";
                    });
                }
            },
            choseCheckAll(list, id) {
                let checkBoxs = list;
                if ($('#' + id + 'choseall').is(":checked")) {
                    for (let j in checkBoxs) {
                        $('#' + id + 'listcheck' + checkBoxs[j].id).prop('checked', true);
                    }
                } else {
                    for (let j in checkBoxs) {
                        $('#' + id + 'listcheck' + checkBoxs[j].id).prop('checked', false);
                    }
                }
            },
            addresetBtn() {
                $('input[name="resetTc"]').val('');
                $('select[name="resetTc"]').val('0');
                $('textarea[name="resetTc"]').val('');
                this.status = 1;
                this.type = 0;
                this.user = 0;
                this.trackstageid = 0;
                this.from = 0;
                this.serviceid = 0;
                this.paytype = 0;
            },
            //-----------------------------------------------------------------------------------------------------------------------------------------------------------------
            getIndexData() {
                this.archivesid = localStorage.trackid;
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/archives/' + this.archivesid,
                    data: {},
                    success: function (data) {
                        AppData.verification(data);
                        AppData.tableDataList = data.info;
                    },
                    error: function (msg) {
                    }
                });
                //获取联系人列表
                this.getContactsData();
                //获取回访列表
                this.getTrackData();
                //获取项目报价列表
                this.getOrderData();
                //获取发票管理列表
                this.getInvoiceData();
                //业务合同
                this.getContractData();
                //业务收款
                this.getCollectionData();
                //开票信息
                this.getBillingData();
            },
            ////////////////////////////////////////////////联系人start
            //获取联系人列表
            getContactsData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/contacts',
                    data: {'listRows': this.listRows, 'page': this.curNum, archivesid: this.archivesid},
                    success: function (data) {
                        AppData.verification(data);
                        AppData.contactsDataList = data.list.data;
                    },
                    error: function (msg) {
                    }
                });
            },
            //新增联系人弹窗
            addcontactClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增联系人',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addContact'),
                    success: function () {
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addContact').hide();
                    }
                })
            },
            //编辑联系人弹窗
            editorcontactClick(id) {
                this.addoredit = id;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '编辑联系人',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addContact'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/contacts/' + id,
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                //编辑框重新赋值
                                $('#contactsname').val(data.info.name);
                                $('#contactscharacter').val(data.info.character);
                                AppData.contactssex = data.info.sex;
                                $('#contactsphone').val(data.info.phone);
                                $('#contactsqq').val(data.info.qq);
                                $('#contactsemail').val(data.info.email);
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addContact').hide();
                    }
                })
            },
            //新增编辑联系人保存
            addeditcontacttssave() {
                var data = {
                    archivesid: this.archivesid,
                    name: $('#contactsname').val(),
                    character: $('#contactscharacter').val(),
                    sex: $("input[name='sexresetTc']:checked").val(),
                    phone: $('#contactsphone').val(),
                    qq: $('#contactsqq').val(),
                    email: $('#contactsemail').val()
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/contacts',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getContactsData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/contacts/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getContactsData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                }
            },
            //删除联系人按钮
            deletecontactClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function () {
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.contactsDataList;
                            for (let i in checkBoxs) {
                                if ($('#contactslistcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/contacts/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        //重新加载列表
                                        AppData.getContactsData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                            }
                        });
                    });
                });
            },
            //////////////////////////////////////////////////联系人end
            //////////////////////////////////////////////////回访start
            //获取回访列表
            getTrackData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/track',
                    data: {'listRows': this.listRows, 'page': this.curNum, archivesid: this.archivesid},
                    success: function (data) {
                        AppData.verification(data);
                        AppData.trackDataList = data.list.data;
                    },
                    error: function (msg) {
                    }
                });
            },
            //新增回访弹窗
            addvisitClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增回访',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '650px'],
                    content: $('.addVisit'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/track/create',
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                                console.log(AppData.ajaxData);
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addVisit').hide();
                    }
                })
            },
            //编辑回访弹窗
            editorvisitClick(id) {
                this.addoredit = id;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '编辑回访',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '650px'],
                    content: $('.addVisit'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/track/' + id,
                            data: {},
                            success: function (data) {
                                console.log(data);
                                AppData.verification(data);
                                AppData.ajaxData = data;
                                //编辑框重新赋值
                                $('#trackremindtime').val(data.info.tracktime);
                                $('#tracktracktime').val(data.info.tracktime);
                                $('#trackcontent').val(data.info.content);
                                AppData.status = data.info.status;
                                AppData.type = data.info.trackfunid;
                                AppData.user = data.info.userid;
                                AppData.trackstageid = data.info.trackstageid;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addVisit').hide();
                    }
                })
            },
            //新增编辑回访保存
            addedittracksave() {
                var data = {
                    archivesid: this.archivesid,
                    status: $('#trackstatus').val(),
                    remindtime: $('#trackremindtime').val(),
                    title: $('#archivescustomer').text(),
                    contacts: $('#archivescontacts').text(),
                    tracktime: $('#tracktracktime').val(),
                    trackfunid: $('#trackfunid').val(),
                    userid: $('#trackuserid').val(),
                    trackstageid: $('#trackstageid').val(),
                    content: $('#trackcontent').val()
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/track',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getTrackData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/track/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getTrackData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                }
            },
            //删除回访按钮
            deletetrackClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function () {
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.trackDataList;
                            for (let i in checkBoxs) {
                                if ($('#tracklistcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/track/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        //重新加载列表
                                        AppData.getTrackData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                            }
                        });
                    });
                });
            },
            //////////////////////////////////////////////////回访end
            //////////////////////////////////////////////////项目报价start
            //获取项目报价列表
            getOrderData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/order',
                    data: {'listRows': this.listRows, 'page': this.curNum, archivesid: this.archivesid},
                    success: function (data) {
                        AppData.verification(data);
                        AppData.orderDataList = data.list.data;
                    },
                    error: function (msg) {
                    }
                });
            },
            //新增项目报价弹窗
            addprojectClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增项目报价',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addProject'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/order/create',
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addProject').hide();
                    }
                })
            },
            //项目报价编辑弹窗开始
            editorprojectClick(id) {
                this.addoredit = id;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '编辑项目报价',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addProject'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/order/' + id,
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                                //编辑框赋值
                                $('#orderprice').val(data.info.orderprice);
                                $('#ordersuccesstime').val(data.info.successtime);
                                $('#orderdiscountprice').val(data.info.discountprice);
                                AppData.status = data.info.orderstatusid;
                                AppData.type = data.info.paytypeid;
                                AppData.from = data.info.fromid;
                                AppData.user = data.info.userid;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addProject').hide();
                    }
                })
            },
            //新增编辑项目报价保存
            addeditordersave() {
                var data = {
                    archivesid: this.archivesid,
                    orderstatusid: $('#orderstatus').val(),
                    orderprice: $('#orderprice').val(),
                    paytypeid: $('#orderpaytype').val(),
                    fromid: $('#orderfrom').val(),
                    userid: $('#orderuser').val(),
                    discountprice: $('#orderdiscountprice').val(),
                    customer: $('#archivescustomer').text(),
                    successtime: $('#ordersuccesstime').val()
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/order',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getOrderData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/order/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getOrderData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                }
            },
            //删除项目报价按钮
            deleteorderClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function () {
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.orderDataList;
                            for (let i in checkBoxs) {
                                if ($('#orderlistcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/order/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        //重新加载列表
                                        AppData.getOrderData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                            }
                        });
                    });
                });
            },
            //////////////////////////////////////////////////项目报价end
            //////////////////////////////////////////////////发票管理start
            //获取发票管理列表
            getInvoiceData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/invoice',
                    data: {'listRows': this.listRows, 'page': this.curNum, archivesid: this.archivesid},
                    success: function (data) {
                        AppData.verification(data);
                        AppData.invoiceDataList = data.list.data;
                    },
                    error: function (msg) {
                    }
                });
            },
            //发票管理新增弹窗开始
            addinvoiceClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增发票',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addInvoice'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/invoice/create',
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addInvoice').hide();
                    }
                })
            },
            //发票管理编辑弹窗开始
            editorinvoiceClick(id) {
                this.addoredit = id;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增发票',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addInvoice'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/invoice/' + id,
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                                //编辑框重新赋值
                                $('#invoiceprice').val(data.info.invoiceprice);
                                $('#invoicemaketime').val(data.info.maketime);
                                AppData.type = data.info.invoicetypeid;
                                AppData.status = data.info.ismake;
                                AppData.from = data.info.contractid;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addInvoice').hide();
                    }
                })
            },
            //新增编辑项目报价保存
            addeditinvoicesave() {
                var data = {
                    invoicetypeid: $('#invoicetype').val(),
                    invoiceprice: $('#invoiceprice').val(),
                    maketime: $('#invoicemaketime').val(),
                    contractid: $('#invoicefrom').val(),
                    ismake: $('#invoiceismake').val()
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/invoice',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getInvoiceData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/invoice/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getInvoiceData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                }
            },
            //发票管理删除按钮
            deleteinvoiceClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function () {
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.invoiceDataList;
                            for (let i in checkBoxs) {
                                if ($('#invoicelistcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/invoice/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        //重新加载列表
                                        AppData.getInvoiceData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                            }
                        });
                    });
                });
            },
            //////////////////////////////////////////////////发票管理end
            //////////////////////////////////////////////////开票管理start
            //获取开票信息列表
            getBillingData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/billing',
                    data: {'listRows': this.listRows, 'page': this.curNum, archivesid: this.archivesid},
                    success: function (data) {
                        AppData.verification(data);
                        console.log(data);
                        AppData.billingDataList = data.list.data;
                    },
                    error: function (msg) {
                    }
                });
            },
            //开票信息新增弹窗开始
            addBillingClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增发票',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addBilling'),
                    success: function () {

                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addBilling').hide();
                    }
                })
            },
            //开票信息编辑弹窗开始
            editorbillingClick(id) {
                this.addoredit = id;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '编辑发票',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addBilling'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/billing/' + id,
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                //编辑框重新赋值
                                $('#billingtitle').val(data.info.title);
                                $('#billingtel').val(data.info.tel);
                                $('#billingbank').val(data.info.bank);
                                $('#billingcode').val(data.info.code);
                                $('#billingaddress').val(data.info.address);
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addBilling').hide();
                    }
                })
            },
            //开票信息保存
            addeditBillingsave() {
                var data = {
                    archivesid: this.archivesid,
                    title: $('#billingtitle').val(),
                    tel: $('#billingtel').val(),
                    bank: $('#billingbank').val(),
                    code: $('#billingcode').val(),
                    address: $('#billingaddress').val()
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/billing',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            console.log(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getBillingData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/billing/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getBillingData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                }
            },
            //发票管理删除按钮
            deleteBillingClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function () {
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.billingDataList;
                            for (let i in checkBoxs) {
                                if ($('#billinglistcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/billing/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        //重新加载列表
                                        AppData.getBillingData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                            }
                        });
                    });
                });
            },
            //////////////////////////////////////////////////开票管理end
            //////////////////////////////////////////////////业务合同start
            //获取业务合同列表
            getContractData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/contract',
                    data: {'listRows': this.listRows, 'page': this.curNum, archivesid: this.archivesid},
                    success: function (data) {
                        AppData.verification(data);
                        AppData.contractDataList = data.list.data;
                    },
                    error: function (msg) {
                    }
                });
            },
            //业务合同新增弹窗开始
            addcontractClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增业务合同',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addContract'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/contract/create',
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addContract').hide();
                    }
                })
            },
            //业务合同编辑弹窗开始
            editorcontractClick(id) {
                this.addoredit = id;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '编辑业务合同',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addContract'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/contract/' + id,
                            data: {},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                                //编辑框赋值
                                $('#contracttitle').val(data.info.title);
                                $('#contentcontractprice').val(data.info.contractprice);
                                $('#contractsuccesstime').val(data.info.successtime);
                                AppData.type = data.info.contracttypeid;
                                AppData.user = data.info.userid;
                                AppData.serviceid = data.info.serviceid;
                                AppData.paytype = data.info.paytypeid;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addContract').hide();
                    }
                })
            },
            //新增业务合同报价保存
            addeditcontractssave() {
                var data = {
                    archivesid: this.archivesid,
                    title: $('#contracttitle').val(),
                    contractprice: $('#contentcontractprice').val(),
                    successtime: $('#contractsuccesstime').val(),
                    contracttypeid: $('#contracttype').val(),
                    userid: $('#contractuser').val(),
                    serviceid: $('#contractserviceid').val(),
                    paytypeid: $('#contractpaytype').val(),
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/contract',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getContractData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/contract/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getContractData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                }
            },
            //业务合同删除按钮
            deletecontractClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function () {
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.contractDataList;
                            for (let i in checkBoxs) {
                                if ($('#contractlistcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/contract/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        //重新加载列表
                                        AppData.getContractData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                            }
                        });
                    });
                });
            },
            //////////////////////////////////////////////////业务合同end
            //////////////////////////////////////////////////业务收款start
            //获取业务收款列表
            getCollectionData() {
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    url: '/collection',
                    data: {'listRows': this.listRows, 'page': this.curNum, archivesid: this.archivesid},
                    success: function (data) {
                        AppData.verification(data);
                        AppData.collectionDataList = data.list.data;
                    },
                    error: function (msg) {
                    }
                });
            },
            //业务收款新增弹窗开始
            addcollectionClick() {
                this.addresetBtn();
                this.addoredit = 0;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增收款',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addCollection'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/collection/create',
                            data: {archivesid: AppData.archivesid},
                            success: function (data) {
                                console.log(data);
                                AppData.verification(data);
                                AppData.ajaxData = data;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addCollection').hide();
                    }
                })
            },
            //业务收款编辑弹窗开始
            editorcollectionClick(id) {
                this.addoredit = id;
                layeraddoredit = layer.open({
                    type: 1,
                    title: '新增收款',
                    maxmin: true,
                    resize: true,
                    shadeClose: false, //点击遮罩关闭层
                    area: ['700px', '550px'],
                    content: $('.addCollection'),
                    success: function () {
                        $.ajax({
                            type: "GET",
                            dataType: "json",
                            url: '/collection/' + id,
                            data: {archivesid: AppData.archivesid},
                            success: function (data) {
                                AppData.verification(data);
                                AppData.ajaxData = data;
                                //编辑框赋值
                                $('#collectionprice').val(data.info.collectionprice);
                                $('#collectiontime').val(data.info.collectiontime);
                                AppData.contractid = data.info.contractid;
                                AppData.type = data.info.paytypeid;
                                AppData.user = data.info.userid;
                            },
                            error: function (msg) {
                            }
                        });
                    },
                    end: function () { //解决弹窗关闭以后,弹窗内容还出现在下方的问题
                        $('.addCollection').hide();
                    }
                })
            },
            //新增业务收款报价保存
            addeditcollectionsave() {
                var data = {
                    archivesid: this.archivesid,
                    collectionprice: $('#collectionprice').val(),
                    collectiontime: $('#collectiontime').val(),
                    contractid: $('#collectioncontract').val(),
                    paytypeid: $('#collectionpaytype').val(),
                    userid: $('#collectionuser').val()
                };
                if (this.addoredit == 0) {
                    //新增
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: '/collection',
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getCollectionData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                } else {
                    //编辑
                    $.ajax({
                        type: "PUT",
                        dataType: "json",
                        url: '/collection/' + this.addoredit,
                        data: data,
                        success: function (data) {
                            AppData.verification(data);
                            if (data.status == 1) {
                                layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                    AppData.getCollectionData();
                                    layer.close(layeraddoredit);
                                });
                            } else {
                                layer.msg(data.message, {icon: 2, time: 1000});
                            }
                        },
                        error: function (msg) {
                        }
                    });
                }
            },
            //删除业务收款按钮
            deletecollectionClick(deleteid) {
                layui.use('layer', function () {
                    layer.confirm('确认要删除吗？', {
                        btn: ['确定', '取消']//按钮
                    }, function () {
                        let ids = [];
                        if (deleteid) {
                            //单个删除
                            ids.push(deleteid);
                        } else {
                            //全部删除
                            let checkBoxs = AppData.collectionDataList;
                            for (let i in checkBoxs) {
                                if ($('#collectionlistcheck' + checkBoxs[i].id).is(":checked")) {
                                    ids.push(checkBoxs[i].id);
                                }
                            }
                        }
                        if (ids.length == 0) {
                            layer.msg('请选择你要删除的选项');
                            return false;
                        }
                        $.ajax({
                            type: "DELETE",
                            dataType: "json",
                            url: '/collection/0',
                            data: {'ids': ids},
                            success: function (data) {
                                AppData.verification(data);
                                if (data.status == 1) {
                                    layer.msg(data.message, {icon: 1, time: 1000}, function () {
                                        //重新加载列表
                                        AppData.getCollectionData();
                                    });
                                } else {
                                    layer.msg(data.message, {icon: 2, time: 1000});
                                }
                            },
                            error: function (msg) {
                            }
                        });
                    });
                });
            },
            //////////////////////////////////////////////////业务收款end
        }
    })
</script>
</body>
</html>
